package com.liveinstars.api.facade;

import com.liveinstars.api.dto.*;
import com.onepiece.shipelves.common.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;


/**
 * 账号相关，需要通过网关进行授权才能访问
 */
@FeignClient("account")
public interface UserAccountApi {

    @PostMapping("/accountopen/login")
    Result<UserLoginInfo> login(@RequestBody LoginRequest request);

    @PostMapping("/accountopen/bind")
    Result<UserLoginInfo> bind(@RequestBody BindRequest request);

    @PostMapping("/accountopen/register")
    Result<Boolean> register(@RequestBody RegisterRequest request);

    @GetMapping("/account/osstoken")
    Result<OssToken> ossToken();

    @PostMapping("/accountopen/smsLogin")
    Result<Boolean> smsLogin(@RequestBody PhoneSmsRequest request);

    @PostMapping("/accountopen/refreshToken")
    Result<UserLoginInfo> refreshToken(@RequestBody RefreshJWT request);

    @PostMapping("/account/unifyAppUpdatePwd")
    Result<UpdateUserpwdVO> unifyAppUpdatePwd(@RequestBody UnifyAppUpdatepwdReq request, @RequestHeader("uid") Integer userId);

    @PostMapping("/account/unifyUpdateUserInfo")
    Result<Boolean> unifyUpdateUserInfo(@RequestBody UnifyAppUpdateUserInfoReq request, @RequestHeader("uid") Integer userId);



}
